package com.company.cloud.web.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.company.cloud.web.service.WebArtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Controller
@RequestMapping("/agreement")
public class AgreementController {

    @Autowired
    private WebArtService webArtService;

    /**
     * 隐私政策
     */
    @RequestMapping("/policy")
    public String privatePolicy(Model model, @RequestParam Map<String, String> params, @CookieValue(value = "org.springframework.web.servlet.i18n.CookieLocaleResolver.LOCALE", defaultValue = "zh-CN") String i18n) {
        System.out.println("++++++++++++ AgreementController:policy");
        return "agreement/policy";
    }

    /**
     * 用户协议
     */
    @RequestMapping("/users")
    public String usersAgreement(Model model, @RequestParam Map<String, String> params, @CookieValue(value = "org.springframework.web.servlet.i18n.CookieLocaleResolver.LOCALE", defaultValue = "zh-CN") String i18n) {
        System.out.println("++++++++++++ AgreementController:users");
        return "agreement/users";
    }

}
